//2009/08/20 23:51:46
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class StringSegment
{
public:
    double average(string s)
    {
		double sum = 0;
		int cnt = 1;
		int count = 1;;
		for(int i=1; i<s.size(); i++)
		{
			if(s[i] != s[i-1])
			{
				cout << "Count: " << count << endl;
				sum += 1.0 * count;
				cout << "Sum: " << sum << endl;
				count = 1;
				cout << "cnt" << cnt << endl;
				cnt ++;
			}
			else
			{
				count++;
			}
		}
		sum += 1.0 * count;
		cout << "cnt" << cnt << endl;
		return sum / cnt;
    }
};
